import 'package:flutter/material.dart';
import 'package:flutter_rider/utils/screen_fit.dart';
import '../../../main/widgets/ui_constant.dart';

class UBackground {
  static Container getItemBlock(List<Widget> children) {
    return Container(
      width: double.infinity,
      //margin: EdgeInsets.fromLTRB(16.rpx, 0.rpx, 16.rpx, 0.rpx),
      decoration: BoxDecoration(
        color: UIColor.color_content,
        // borderRadius:
        // BorderRadius.all(Radius.circular(8.rpx)),
      ),
      padding: EdgeInsets.all(14.rpx),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: children,
      ),
    );
  }

  static Container getHorzItemBlock(List<Widget> children,
      {double radius = 0, GestureTapCallback? onTap}) {
    return Container(
      width: double.infinity,
      margin: EdgeInsets.fromLTRB(16.rpx, 0.rpx, 16.rpx, 0.rpx),
      child: Material(
        color: UIColor.color_content,
        borderRadius: BorderRadius.all(Radius.circular(radius)),
        child: InkWell(
          borderRadius: BorderRadius.all(Radius.circular(radius)),
          onTap: onTap,
          child: Container(
            padding: EdgeInsets.all(12.rpx),
            child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: children),
          ),
        ),
      ),
    );
  }
}
